var express = require('express');
var router = express.Router();
const mongoose = require('mongoose');
mongoose.connect('mongodb://localhost/test');
/* GET home page. */
router.post('/', function(req, res, next) {
  const Cat = mongoose.model('Cat', { name: String });
  const kitty = new Cat({ name:req.body.name});
  kitty.save().then((data) =>  res.json(data));
 
});

module.exports = router;
